package com.wmjsoft.plugins.security

import com.wmjsoft.plugins.security.config.SecurityConfig
import net.cloudopt.next.web.Plugin
import net.cloudopt.next.web.config.ConfigManager


class SecurityPlugin: Plugin {
    override fun start(): Boolean {
        val config = ConfigManager.init("security")

        SecurityConfig.ignorePath = if(config["ignorePath"] == null) "" else config["ignorePath"] as String
        SecurityConfig.headersKey = if(config["headersKey"] == null) "" else config["headersKey"] as String
        SecurityConfig.prefix = if(config["prefix"] == null)  "" else config["prefix"] as String
        return true
    }

    override fun stop(): Boolean {
        return true
    }

}